<?php /* D:\phpStudy\PHPTutorial\WWW\laravel_blog\resources\views/admin/admin/edit.blade.php */ ?>
<?php echo $__env->make('admin.public._head', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>
<!-- /Navbar -->
<!-- Main Container -->
<div class="main-container container-fluid">
    <!-- Page Container -->
    <div class="page-container">

        <!-- Page Sidebar -->
    <?php echo $__env->make('admin.public._left', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>
    <!-- /Page Sidebar -->
        <!-- Page Content -->
        <div class="page-content">
            <!-- Page Breadcrumb -->
            <div class="page-breadcrumbs">
                <ul class="breadcrumb">
                    <li class="active">
                        <i class="fa fa-home"></i>&nbsp;管理员管理
                    </li>
                    <li>
                        管理员编辑
                    </li>
                </ul>
            </div>
            <!-- /Page Breadcrumb -->
            <!-- Page Body -->
            <div class="page-body">
                <div class="row">
                    <div class="col-xs-12">
                        <div class="widget radius-bordered">
                            <div class="widget-header bordered-bottom bordered-themeprimary">
                                <span class="widget-caption">管理员添加</span>
                            </div>
                            <div class="widget-body">
                                <form class="form-horizontal">
                                    <input type="hidden" name="id" value="<?php echo e($admin->id); ?>">
                                    <div class="form-group">
                                        <label for="catename" class="col-sm-2 control-label no-padding-right">账号</label>
                                        <div class="col-sm-6">
                                            <input type="text" class="form-control" name="username"
                                                   value="<?php echo e($admin->username); ?>" placeholder="请输入账号"/>
                                        </div>
                                    </div>

                                    <div class="form-group">
                                        <label for="catename" class="col-sm-2 control-label no-padding-right">密码</label>
                                        <div class="col-sm-6">
                                            <input type="text" class="form-control" name="password"
                                                   value="<?php echo e($admin->password); ?>" placeholder="请输入密码"/>
                                        </div>
                                    </div>

                                    <div class="form-group">
                                        <label for="catename" class="col-sm-2 control-label no-padding-right">昵称</label>
                                        <div class="col-sm-6">
                                            <input type="text" class="form-control" name="nickname"
                                                   value="<?php echo e($admin->nickname); ?>" placeholder="请输入昵称"/>
                                        </div>
                                    </div>

                                    <div class="form-group">
                                        <label for="catename" class="col-sm-2 control-label no-padding-right">邮箱</label>
                                        <div class="col-sm-6">
                                            <input type="email" value="<?php echo e($admin->email); ?>" class="form-control" name="email" placeholder="请输入邮箱"/>
                                        </div>
                                    </div>


                                    <div class="form-group">
                                        <div class="col-sm-offset-2 col-sm-10">
                                            <button type="submit" class="btn btn-primary" id="admin_add">添加</button>
                                        </div>
                                    </div>
                                </form>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            <!-- /Page Body -->
        </div>
        <!-- /Page Content -->

    </div>
    <!-- /Page Container -->
    <!-- Main Container -->

</div>

<?php echo $__env->make('admin.public._js', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>
<script>
    $('#admin_add').click(function () {
        $.ajax({
            url: "<?php echo e(url('admin/admin_edit')); ?>",
            type: 'post',
            data: $('form').serialize(),
            dataType: 'json',
            success: function (data) {
                if (data.code == 1) {
                    layer.msg(data.msg, {
                        icon: 6,
                        time: 2000
                    }, function () {
                        location.href = data.url
                    });
                } else {
                    layer.open({
                        title: '添加失败',
                        content: data.msg,
                        icon: 5,
                        anim: 6
                    });
                }
            }
        });
        return false;
    });
</script>
</body>
<!--  /Body -->
</html>
